﻿///////////////////////////////////////////////////////////////////////////////
///
/// Cylan Client Core
/// Copyright (C) Shenzhen Cylan Tech. Co., Ltd. 2012
///
/// @file       SGAError.h
/// @brief      SGA错误码表
///
///////////////////////////////////////////////////////////////////////////////
#ifndef CYLAN_SGA_ERROR_H
#define CYLAN_SGA_ERROR_H

#define SGA_ERROR_OK                                                 (0)
#define SGA_ERROR_USER_NAME_EMPTY                                    (-493)
#define SGA_ERROR_USER_PASSWORD_EMPTY                                (-494)
#define SGA_ERROR_CERSN_EMPTY                                        (-495)
#define SGA_ERROR_USER_NAME_TOO_LONG                                 (-496)
#define SGA_ERROR_USER_PASSWORD_TOO_LONG                             (-497)
#define SGA_ERROR_USER_TURENAME_TOO_LONG                             (-498)
#define SGA_ERROR_CERSN_TOO_LONG                                     (-499)
#define SGA_ERROR_USER_DESC_TOO_LONG                                 (-492)
#define SGA_ERROR_USER_PHONE_TOO_LONG                                (-491)
#define SGA_ERROR_USER_MAIL_TOO_LONG                                 (-490)
#define SGA_ERROR_DB                                                 (-500)
#define SGA_ERROR_MKID                                               (-501)
#define SGA_ERROR_NOMEM                                              (-502)
#define SGA_ERROR_FILELOCK                                           (-503)
#define SGA_ERROR_NAME_EXIST                                         (-504)
#define SGA_ERROR_CERT_ISUSED                                        (-506)
#define SGA_ERROR_NETTONET_EXIST                                     (-507)
#define SGA_ERROR_SITE_HOST_EXIST                                    (-508)
#define SGA_ERROR_MAIL_ISUSED                                        (-509)
#define SGA_ERROR_MAIL_SERVER_NOTREQISTER                            (-510)
#define SGA_ERROR_MAIL_SERVER_CONNECT                                (-511)
#define SGA_ERROR_TRUENAME_EXIST                                     (-521)
#define SGA_ERROR_FILEPATH_EXIST                                     (-505)
#define SGA_ERROR_FORBIDDEN                                          (-513)
#define SGA_ERROR_PORT_INVALID                                       (-514)
#define SGA_ERROR_PORT_INUSE                                         (-515)
#define SGA_ERROR_IPVIRTUALIP_EXIST                                  (-516)
#define SGA_ERROR_IPVITTUALIP_FAILUE                                 (-517)
#define SGA_ERROR_HTML_TEMP_CANNOT_LOAD                              (-518)
#define SGA_ERROR_SITE_FORBIDDEN                                     (-519)
#define SGA_ERROR_IP_ISBAIND                                         (-520)
#define SGA_ERROR_VERIFY_SMSPASS                                     (-400)
#define SGA_ERROR_VERIFY_CERTBAIND                                   (-401)
#define SGA_ERROR_VERIFY_USERPASS                                    (-402)
#define SGA_ERROR_VERIFY_FINGER                                      (-403)
#define SGA_ERROR_VERIFY_IMAGECODE                                   (-404)
#define SGA_ERROR_VERIFY_MACBIND                                     (-405)
#define SGA_ERROR_VERIFY_CRL                                         (-406)
#define SGA_ERROR_VERIFY_SIMBIND                                     (-407)
#define SGA_ERROR_VERIFY_OTPPASS_ERROR                               (-408)
#define SGA_ERROR_VERIFY_OTPPASS_NEED                                (-409)
#define SGA_ERROR_VERIFY_EXLOCALPASS_NEED                            (-410)
#define SGA_ERROR_VERIFY_EXLOCALPASS_ERROR                           (-411)
#define SGA_ERROR_NO_CHANGEPASS_PERM                                 (-421)
#define SGA_ERROR_LDAP_NOT_COMFORM_PASSWDPOLICY                      (-427)
#define SGA_ERROR_NO_LICENSE                                         (-479)
#define SGA_ERROR_LICENSE_HAS_EXPIRED                                (-480)
#define SGA_ERROR_SESSION_TIMEOUT                                    (-483)
#define SGA_ERROR_VERIFY_SMSPASS_TIMEOUT                             (-601)
#define SGA_ERROR_VERIFY_CERTUSED                                    (-602)
#define SGA_ERROR_VERIFY_USERFORBIDDEN                               (-604)
#define SGA_ERROR_VERIFY_SMS_SEND                                    (-605)
#define SGA_ERROR_VERIFY_FINGER_NOUSER                               (-606)
#define SGA_ERROR_VERIFY_SMS_NEED                                    (-607)
#define SGA_ERROR_VERIFY_CANNOT_GETUSER                              (-608)
#define SGA_ERROR_VERIFY_DATABASE                                    (-609)
#define SGA_ERROR_VERIFY_USERLOCK                                    (-610)
#define SGA_ERROR_VERIFY_MAILSERVER                                  (-611)
#define SGA_ERROR_VERIFY_USEREXPIRED                                 (-612)
#define SGA_ERROR_VERIFY_CERTNOUSER_BIAND                            (-613)
#define SGA_ERROR_VERIFY_PASS_NEED                                   (-614)
#define SGA_ERROR_VERIFY_MAILHOSTNAME                                (-615)
#define SGA_ERROR_VERIFY_MAILUSER                                    (-616)
#define SGA_ERROR_VERIFY_MAILPASS                                    (-617)
#define SGA_ERROR_VERIFY_OCSP                                        (-618)
#define SGA_ERROR_VERIFY_MAIL                                        (-619)
#define SGA_ERROR_VERIFY_UNSESS_FAILED                               (-620)
#define SGA_ERROR_LOGIN_SITE_TIMEFORBIDDEN                           (-704)
#define SGA_ERROR_LOGIN_SITE_DISALBLE                                (-705)
#define SGA_ERROR_LOGIN_CERTBAIND                                    (-706)
#define SGA_ERROR_LOGIN_NOSITEACCESS_RIGHTE                          (-707)
#define SGA_ERROR_LOGIN_NOVERIFYINFOR                                (-708)
#define SGA_ERROR_LOGIN_CERTNEED                                     (-709)
#define SGA_ERROR_LOGIN_SITENOTEXIST                                 (-710)
#define SGA_ERROR_LOGIN_USERHAVELOGIN                                (-712)
#define SGA_ERROR_LOGIN_TIME_FORBIDDEN                               (-715)
#define SGA_ERROR_LOGIN_EXCEEDGROUPMAXLOGIN                          (-716)
#define SGA_ERROR_LOGIN_EXCEEDSITEMAXLOGIN                           (-717)
#define SGA_ERROR_LOGIN_EXCEEDLICENSELOGIN                           (-719)
#define SGA_ERROR_LOGIN_UNUSEDSITE                                   (-720)
#define SGA_ERROR_LOGIN_USERNOTLOGIN                                 (-721)
#define SGA_ERROR_SITEHOST_EXIST                                     (-723)
#define SGA_ERROR_LOGIN_NO_RINGHTUSER                                (-724)
#define SGA_ERROR_CHECK_PASS_TIME_ADJUST                             (-725)
#define SGA_ERROR_CHECK_PASS_FAIL                                    (-726)

#define LOGIN_CHECK_VERSION_ERROR                                    (-727)
#define LOGIN_CHECK_MOBILE_NETWORK_ERROR                             (-728)
#define LOGIN_CHECK_UNICOM_NETWORK_ERROR                             (-729)
#define LOGIN_CHECK_TELECOM_NETWORK_ERROR                            (-730)
#define LOGIN_CHECK_WIFI_NETWORK_ERROR                               (-731)
#define LOGIN_CHECK_3G_NETWORK_ERROR                                 (-732)
#define LOGIN_CHECK_3G_NETWORK_ISP_ERROR                             (-733)
#define SGA_ERROR_CHECK_PASS_FAIL_LEN                                (-734)//password too short
#define SGA_ERROR_CHECK_PASS_FAIL_CASE                               (-735)//password not contains uppercase and lowercase letters
#define SGA_ERROR_CHECK_PASS_FAIL_NUM                                (-736)//no number
#define SGA_ERROR_CHECK_PASS_FAIL_SPECIAL                            (-737)//no sepcial character
#define SGA_ERROR_CHECK_PASS_FAIL_NAME_DIFF                          (-738)//same as user name

#define SGA_ERROR_CHECK_MACBIND_BLANK                                (-810)
#define SGA_ERROR_CONF_SAVE_FAIL                                     (-820)
#define SGA_ERROR_VERIFY_CONNECT_FINGERSERVER_FAILURE                (-821)
#define SGA_ERROR_VERIFY_GETUSER_FINGER_FAILURE                      (-822)
#define SGA_ERROR_VERIFY_UKEY_FAILURE                                (-823)
#define SGA_ERROR_VERIFY_NOUKEY_RIGHT                                (-824)
#define SGA_ERROR_VERIFY_NOPONE_RIGHT                                (-825)
#define SGA_ERROR_VERIFY_UKEY_NEED                                   (-826)
#define SGA_ERROR_BYOND_MAXUSER                                      (-827)
#define SGA_ERROR_FORCE_USECERT_LOGIN                                (-828)
#define SGA_ERROR_VERIFY_NO_ENABLED_GROUP                            (-829)
#define SGA_ERROR_HA_IP_REJECT                                       (-900)
#define SGA_ERROR_HA_START                                           (-901)
#define SGA_ERROR_HA_CONNECT                                         (-902)
#define SGA_ERROR_HA_MODE_REJECT                                     (-903)
#define SGA_ERROR_CHECK_SIMBIND_BLANK                                (-910)
#define SGA_ERROR_CHECK_IP                                           (-920)
#define SGA_ERROR_CHECK_IOS_HWID                                     (-921)
#define SGA_ERROR_CHECK_ANDROID_IMSI                                 (-922)
#define SGA_ERROR_CERT_DOWNLOAD_FAILED                               (-927)

/**
 * @typedef SGA_ERROR_CODE
 * @brief SGA错误码类型
 */
typedef int SGA_ERROR_CODE;

/**
 * @fn const char *CSGAErrorString(SGA_ERROR_CODE ErrorCode)
 * @brief 获取SGA错误码对应的标记
 * @param ErrorCode SGA错误码
 * @return 错误描述
 */
const char *CSGAErrorString(SGA_ERROR_CODE ErrorCode);

#endif /* CYLAN_SGA_ERROR_H */
